package org.hawk.gwt.ppc.parser;

import java.util.List;

/**
 * Provides descriptor for imports section (if any). 
 * 
 * @author alex.bereznevatiy@gmail.com
 *
 */
public interface ImportsDescriptor extends Descriptor {
	
	/**
	 * Resolves class name according to imports and returns all possible
	 * names that matches given short name. 
	 * Order of priority of names:
	 * 1) If there is strict match between import and name - it will be used and other steps are skipped.
	 * 2) Otherwise package-private name will be used
	 * 3) Otherwise wildcard import names will be used.
	 *    Order of wildcard names is not matter since compiler should resolve ambiguous imports.
	 * 4) Otherwise name will be imported from java.lang package.
	 * 5) Otherwise name will be searched in default package
	 * 
	 * @param name to resolve
	 * @return list of names, first comes with highest priority, last with lowest priority.
	 */
	List<String> resolveClass(String name);
	
	/**
	 * Resolves method name according static imports (if any).
	 * If there is a strict match - returns singleton list.
	 * If there are wildcard matches - returns all possible variants.
	 * Otherwise returns zero-size list.
	 * @param name
	 * @return list of possible method full names.
	 */
	List<String> resolveMethod(String name);
}
